package com.robotboy.data.web.controller;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor;
import com.robotboy.data.base.BaseController;
import com.robotboy.data.entity.Match;
import com.robotboy.data.service.MatchService;

@Controller
@RequestMapping(value = "/test")
public class TestController extends BaseController {

	private Log logger = LogFactory.getLog(getClass());
	
	@Autowired
	private MatchService matchService;

	@RequestMapping(value = "/index")
	public @ResponseBody String index(ModelMap map) {
		logger.info("request start.........");
		List<Match> matchList = matchService.findAll();
		map.put("matchList", matchList);
		return "{\"a\":\"123\"}";
	}

}
